PlantSight Enterprise Help

ECExpression Examples

The following table represents some common examples of ECExpressions that are supported in PlantSight:

ECExpression Type of Expression Example
GetRelatedInstance this.GetRelatedInstance this.GetRelatedInstance("PLANT_AREA_HAS_NAMED_ITEM:1:PLANT_AREA").NAME
Nested GetRelatedInstance this.GetRelatedInstance("SEGMENT_HAS_PIPING_COMPONENT:1:PIPING_NETWORK_SEGMENT").GetRelatedInstance("PIPELINE_HAS_SEGMENT:1:PIPING_NETWORK_SYSTEM").PLANT_AREA
Note: Piping Network Segment should be created from OPPID to define tags in Data Manager.
System.String System.String.Substring System.String.Substring(this.DESCRIPTION,0,3)
System.String.Format System.String.Format("{0:D3}", this.DRY_WEIGHT)
System.String.Compare System.String.Compare("HEIGHT", "LENGTH")
IIF statements IFF Statements IIF(this.FLOW_RATE=0,this.MAXIMUM_PRESSURE,this.FLOW_RATE)
Nested IIF Statements IIF(this.FLOW_RATE=0,this.MAXIMUM_PRESSURE,IIF(this.FLOW_RATE=10,this.MAXIMUM_PRESSURE,this.FLOW_RATE))
Mathematical expressions /,*,+.- (this.ELEVATION + this.DRY_WEIGHT)
Note: All mathematical expressions should be enclosed in parentheses "( )"
Expression applied on properties other than Name Expression applied on ALIAS Property this.DESCRIPTION

For more information about ECExpressions and the Expression Editor, see"Expression Editor" OpenPlant Project Administrator Help.

Note:
  1. The ClassName defined in the schema should be in all capital letters.

    For example PLANT_AREA or DEVICE_TYPE_CODE.

  2. Combo box is visible only if the this.GetRelatedInstance is used to define the ECExpression.

    For example; this.GetRelatedInstance("PLANT_AREA_HAS_NAMED_ITEM:1:PLANT_AREA").NAME & "-" & this.DEVICE_TYPE_CODE & "-" & this.NUMBER


    Combo box allows you to select the pre-defined tags.
  3. If the ECExpression does not contain this.GetRelatedInstance
    For example; this.PLANT_AREA & "-" & this.DEVICE_TYPE_CODE & "-" & this.NUMBER, combo box will not be visible and a warning message is given upon saving the tag.